/*==================================================
Project:       Targeting Social Programs
Authors:       Diether W. Beuermann
               Bridget Hoffmann        
               Marco Stampini 
               David L. Vargas
               Diego Vera-Cossio
----------------------------------------------------
Creation Date:    
Modification Date:   
Do-file version:    01
References:          
Output:             
==================================================*/


/*==================================================
            0: Program set up
==================================================*/
*Written on STATA 17
drop _all
set varabbrev off	// no variable abbreviations allowed (personal preference)

** source dir
cd "${dir4r}" // tables dir

*----------  1.1. Estimate PMT coefficients for population data
* For convenience all pmt relevant coefficients are availible in a aux dta *
use "${dir3r}/01_survey/survey_targeting_r1_long.dta", clear

** we stick to 2019 to estimate the models
keep if year == 2019 

*Globals with updted survey variables
glo hh_char_srv urban age_feb20_srv prop_kids_srv n_members_srv elementary_srv highschool_srv tertiary_edu_srv children_srv living_couple
glo assets_srv own_washing_machine_srv own_tractor_srv own_moto_srv own_car_srv own_PC_srv own_fridge_srv
glo hh_srv  wall_finished_srv floor_finished_srv cookpower_connected_srv wc_flush_srv kitchen_srv electricity_srv running_water_srv trash_service_srv 
glo labour_srv formal_work_srv informal_work_srv

glo pmt_1_srv  $hh_char_srv $assets_srv $hh_srv $labour_srv

label var children_srv "Has children"
label var living_couple "Household head cohabits with partner"
label var wall_finished_srv "Finished walls"
label var l_pp_inc_srv "Log. per-capita income"
//>>>>>>>>>>> 1.1. Estimation

// model 1 - with labour // survey data 
reg l_pp_inc_srv $pmt_1_srv [aw=pondera]  , robust
outreg using "TA3_PMT_baseline_srv.tex", replace varlabel tex frag nolegend 


//==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END ==== END